//用户信息表
var userApp = new Vue({
    el: '#userApp',
    data: {
        user_arr: [{"userId":"123@qq.com",
            "headShot":"D:/图片1.jpg",
            "password":"123456",
            "nicknames":"",
            "introduction":"",
            "paypassword":null,
            "vip":"否",
            "credibility":"60",
            "alias":null, //别名
            "subscribe":0,
            "fans":0,
            "phone":null}],
        pageInfo: {},
    },
    methods: {
        loadUsers: function (pageNum) {
            if (!pageNum) {
                //默认查询第一页
                pageNum = 1;
            }
            axios.get("/userlist", {
                params: {
                    pageNum: pageNum,
                }
            }).then(function (response) {
                userApp.user_arr = response.data.list;
                userApp.pageInfo = response.data;
            }).catch(function (err) {
                alert(err);
            })
        },
        deleteById: function (userId) {
            axios.get("/deleteUserById?userId=" + userId).then(function (response) {
                location.reload();//删除完之后刷新
            }).catch(function (err) {
                alert(err);
            })
        }
    },
    created: function () {
        console.log("执行了方法");
        this.loadUsers();
    }
});
